package org.jeecg.cn.edu.scau.vm.image.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDateTime;

/**
 * 镜像实体类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ToString
@Builder
@TableName("vm_image")
public class VmImage {
    /**
     * 主键ID
     */
    @TableId(type = IdType.AUTO)
    private String id;
    /**
     * 镜像业务主键ID
     */
    @TableField("image_id")
    private String imageId;
    /**
     * 镜像所属部门编码
     */
    @TableField("sys_org_code")
    private String sysOrgCode;
    /**
     * 镜像名称
     */
    @TableField("name")
    private String name;
    /**
     * 镜像地址
     */
    @TableField("hub_url")
    private String hubUrl;
    /**
     * 镜像需要开放的端口
     */
    @TableField("ports")
    private String ports;
    /**
     * 镜像启动指令
     */
    @TableField("command")
    private String command;
    /**
     * 镜像介绍描述
     */
    @TableField("description")
    private String description;
    /**
     * 镜像登录用户名
     */
    @TableField("ssh_username")
    private String sshUsername;
    /**
     * 镜像登录密码
     */
    @TableField("ssh_password")
    private String sshPassword;

    /**
     * 镜像状态
     */
    @TableField("status")
    private Integer status;
    /**
     * 镜像审核者
     */
    @TableField("reviewer")
    private String reviewer;
    /**
     * 镜像审核语
     */
    @TableField("review_msg")
    private String reviewMsg;
    /**
     * 创建容器时的最长超时
     */
    @TableField("create_time_out")
    private Integer createTimeOut;

    @TableField("create_by")
    private String createBy;

    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    @TableField("update_by")
    private String updateBy;


    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField("update_time")
    private LocalDateTime updateTime;

}
